//
//  StringKv.m
//  Etion
//
//  Created by wu jingxing on 12-7-18.
//  Copyright (c) 2012年 GuangZhouXuanWu. All rights reserved.
//

#import "XMSStringKv.h"

@implementation XMSStringKv

- (instancetype)init
{
    self = [super init];
    self.key = @"";
    self.value = @"";

    return self;
}

- (void)setKey:(NSString *)key
{
    [_key release_mm];
    _key = [key copy_mm];
}

- (NSString *)key
{
    return (NSString *) _key;
}

- (void)setValue:(NSString *)value
{
    [_value release_mm];
    _value = [value copy_mm];
}

- (NSString *)value
{
    return (NSString *) _value;
}

- (id)copyWithZone:(NSZone *)zone
{
    XMSStringKv *pair = [[self class] allocWithZone:zone];
    
    pair.key = _key;
    pair.value = _value;
    
    return pair;
}

+ (XMSStringKv *)stringKvWithKey:(NSString *)key value:(NSString *)value
{
    XMSStringKv *kv = [[XMSStringKv new] autorelease_mm];
    kv.key = key;
    kv.value = value;
    return kv;
}

- (void)dealloc
{
    superdealloc_mm;
}

@end
